﻿/*
 * Copyright (C) 2021. Huawei Device Co., Ltd. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the MIT License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * MIT License for more details.
 */


#ifndef UI_DRAW_DASHED_LINE_H
#define UI_DRAW_DASHED_LINE_H

#include "../StdAfx.h"

namespace DuiLib {
class UILIB_API UIDrawDashedLine : public CControlUI {
public:
    UIDrawDashedLine();
    ~UIDrawDashedLine();
    void DoPostPaint(HDC doPaint, const RECT& paintRect) override;
    void SetPoint(POINT* pointArry, int pointNum);
    void SetVisible(const bool visible = true) override;

private:
    Gdiplus::GdiplusStartupInput    gdiplusStartupInput;
    ULONG_PTR   gdiToken;
    void DrawLine(HDC hDC);
    // Up to 10 points
    POINT pointPtr[10] = { 0 };
    int pointNum = 0;
    bool isVisible = true;
};
}

#endif

